import 'package:flutter/material.dart';
import '../components/timer_test.dart';

class KeyDemo extends StatefulWidget {
  @override
  _KeyDemoState createState() => _KeyDemoState();
}

class _KeyDemoState extends State<KeyDemo> {
  Key _key;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: TimeTest(key: _key),
      floatingActionButton: FloatingActionButton(
        onPressed: _changeKey,
      ),
    );
  }
  _changeKey() {
    setState(() {
      _key = UniqueKey();
    });
  }
}